package com.zfp.sys.service;

import com.zfp.core.service.BaseService;
import com.zfp.sys.dao.SysMenuDao;
import com.zfp.sys.entity.SysMenu;
import com.zfp.sys.entity.SysUser;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Repository;
import org.springframework.transaction.annotation.Transactional;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

@Transactional
@Repository("sysMenuService")
public class SysMenuService extends BaseService<SysMenu> {
	@Autowired
	private SysMenuDao sysMenuDao;

	public List getTopMenu(SysUser sysUser){
		List<SysMenu>  sysMenu =  sysMenuDao.list("SysMenu.findtopmenu",sysUser);
		return sysMenu;
	}

	public List getLeftMenu(String menuid,SysUser sysUser){
		Map<String,String> paramap = new HashMap<String,String>();
		paramap.put("menuid",menuid);
		paramap.put("userId",sysUser.getUserId().toString());
		List<SysMenu>  sysMenu =  sysMenuDao.list("SysMenu.findleftmenu",paramap);
		return sysMenu;
	}


}